/**
 * Cake路由模块
 */

var express = require('express');
var router = express.Router();

//导入所需控制
const cakeshelf = require("../controller/cakeshelf");

const auth = require("../controller/auth")
//守卫路由
router.all("*",auth.isLogin)
//更新阅读状态
router.patch("/read-status/:id",cakeshelf.updateReadStatus)
//更新评分
router.patch("/ranking/:id",cakeshelf.updateRanking)

//获取总数
router.get("/count",cakeshelf.getCount);

router.get("/:id",cakeshelf.find);

router.get("/",cakeshelf.findAll);

router.post("/",cakeshelf.add);

router.put("/:id",cakeshelf.update);

router.delete("/:id",cakeshelf.remove);



module.exports = router;